package com.gudaomai.ekproject.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.gudaomai.ekproject.common.EkBaseMapper;
import com.gudaomai.ekproject.entity.UserRole;

/**
 * <p>
 * user_role Mapper 接口
 * </p>
 *
 * @author zenghualu
 * @since 2017-06-26
 */
public interface UserRoleMapper extends EkBaseMapper<UserRole> {

	//根据uid,rid选择记录
	@Select("select * from user_role where uid=#{uid} and role_id=#{rid}")
	public UserRole getUserRoleByUidRid(@Param("uid") String uid, @Param("rid") String rid);
	
	//根据uid,rid删除记录
	@Delete("delete from user_role where uid=#{uid} and role_id=#{rid}")
	public int delUserRoleByUidRid(@Param("uid") String uid, @Param("rid") String rid);
	
	//根据uid获取userrole
	@Select("select * from user_role where uid=#{uid}")
	public List<UserRole> getUserRoleByUid(@Param("uid")String uid);
}